<style>

</style>
<template>
  <div style="background: #2C3E50;height:60vh;margin-top:20vh;text-align: center;">
    <div style="height:15vh"></div>
    <el-form  style="width:30vw;margin-left:30vw;" label-width="80px" ref="form">
      <el-form-item label="车间" >
          <el-input type="text" name="username" v-model="username"></el-input>
      </el-form-item>
      <el-form-item label="优化号">
          <el-input type="password" name="password" v-model="password"></el-input>
      </el-form-item>
      <el-form-item>
           <el-button type="primary" @click="login">登录</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
  import Axios from 'axios';
  import Vue from 'vue';
  import { Login } from '@/request/api';

	export default {
	  data () {
	    return {
        username : '18820421791',
        password : 'xyy00'
	    }
	  },
    mounted(){

    },
    methods:{
      login(){
            Login({
                username: this.username,
                password: this.password
            }).then(res => {
              console.log(res);
              localStorage.setItem('token', res.token);
              this.$router.replace({
                  path: '/production_load_material',
              });
            })
      }
    }

	}
</script>
